<?php
/* @var $this StatusController */
/* @var $model Status */
//
$this->breadcrumbs=array(
	'PotentialCustomers'=>array('index'),
	$modelcustomers->potential_customers_id,
);
?>
<?php
/* @var $this StatusController */
/* @var $model Status */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'status-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->hiddenField($model,'customer_id',array('value'=>$modelcustomers->potential_customers_id)); ?>
		<?php echo $form->error($model,'customer_id'); ?>
	</div>
	<div class="row">
		<?php echo $form->hiddenField($model,'last_called_date_and_time',array('value'=>$model->last_called_date_and_time)); ?>
		<?php echo $form->error($model,'last_called_date_and_time'); ?>
	</div>
		<div class="row">
		<?php echo $form->hiddenField($model,'campaign_id',array('value'=>$model->campaign_id)); ?>
		<?php echo $form->error($model,'campaign_id'); ?>
	</div>	
		<label><?php echo Yii::t('base','Campaign')?>：</label><input type="text" value="<?php echo Campaign::model()->getCampaignName($model->campaign_id);?>"/>
	<label><?php echo Yii::t('base','PotentialCustomersListName')?>：</label><input type="text" value="<?php echo PotentialCustomersList::model()->getPotentialCustomerListName($modelcustomers->potential_customers_id);?>"/>
	<div class="row">
		<?php //echo $form->labelEx($model,'agent_id'); ?>
		<?php echo $form->hiddenField($model,'agent_id',array('value'=>Yii::app()->user->id)); ?>
		<?php echo $form->error($model,'agent_id'); ?>
	<label><?php echo Yii::t('base','FirstName')?>：</label><input type="text" value="<?php echo $modelcustomers->first_name;?>"/>
	<label><?php echo Yii::t('base','LastName')?>：</label><input type="text" value="<?php echo $modelcustomers->last_name;?>"/>
	<label><?php echo Yii::t('base','Phone Number')?>：</label><a href="tel:<?php echo $modelcustomers->mobile;?>"><?php echo $modelcustomers->mobile;?></a><br/>
	<label><?php echo Yii::t('base','Choose One Feedback')?>:</label>
	<input type="radio" name="status" value="1" id="other1">No Answer<br/>
	<input type="radio" name="status" value="2" id="other2">Busy or Not Available<br/>
	<input type="radio" name="status" value="3" id="other3">Invalid Number<br/>
	<input type="radio" name="status" value="4" id="other4">Do not call again<br/>
	<input type="radio" name="status" value="5" id="other5">No interest<br/>
	<input type="radio" name="status" value="6" id="qualified">Qualified lead<br/>
	<input type="radio" name="status" value="7" id="won">Won
	</div>
	
	

<div style="display: none;" id="divform1">
    <!-- 这里是表单1,当用户输入邀请码后显示的表单 -->
      <label><?php echo Yii::t('base','Qualified Lead');?></label>
      <p><span><?php echo Yii::t('base','follow up' );?>: </span>
        <input type="text" id="follow_up1" name="follow_up" size="20" value="<?php echo $model->follow_up=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->follow_up;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" /></p>
      <p><span><?php echo Yii::t('base','sign up date');?> : </span>
        <input type="text" id="sign_up_date1" name="sign_up_date1" size="20" value="<?php echo $model->sign_up_date=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->sign_up_date;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" />
      </p>
      <p><span><?php echo Yii::t('base','Contract Expire date')?> : </span>
        <input type="text" id="contract_expire_date1" name="contract_expire_date1" size="24"  value="<?php echo $model->contract_expire_date=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->contract_expire_date;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" />
      </p>
      <p><span> <?php echo Yii::t('base','Package');?>: </span>
        <input type="text" id="package1" name="package1" size="24" style="width:245px;" />
      </p>
  </div>
  
  
  <div style="display: none;" id="divform2">
    <!-- 这里是表单1,当用户输入邀请码后显示的表单 -->
      <label><?php echo Yii::t('base','Won');?></label>
      <p><span><?php echo Yii::t('base','sign up date');?> : </span>
        <input type="text" id="sign_up_date1" name="sign_up_date" size="20"  value="<?php echo $model->sign_up_date=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->sign_up_date;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" />
      </p>
      <p><span><?php echo Yii::t('base','Contract Expire date');?> : </span>
        <input type="text" id="contract_expire_date1" name="contract_expire_date" size="24" value="<?php echo $model->contract_expire_date=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->contract_expire_date;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" />
      </p>
      <p><span> <?php echo Yii::t('base','Package');?>: </span>
        <input type="text" id="package1" name="package" size="24" style="width:245px;" />
      </p>    
  </div>
  
	<div class="row">
	 <label><?php echo Yii::t('base','Update Client Information');?>：</label>
      <p><span><?php echo Yii::t('base','FirstName');?>： </span>
        <input type="text" id="frist_name1" name="first_name" size="24" style="width:245px;" value="<?php echo $modelcustomers->first_name;?>" />
      </p>

		<p><span><?php echo Yii::t('base','LastName');?>： </span>
        <input type="text" id="last_name1" name="last_name" size="24" style="width:245px;" value="<?php echo $modelcustomers->last_name;?>" />
      </p>
       <div class="row">
      	<?php echo $form->labelEx($modelcustomers,'gender'); ?>
		<?php echo $form->dropDownList($modelcustomers,'gender',array('Mr'=>'Mr','Mrs'=>'Mrs','Ms'=>'Ms','Miss'=>'Miss','Dr'=>'Dr',''=>'--')); ?>
		<?php echo $form->error($modelcustomers,'gender'); ?>    
     </div>
      <p>
        <input type="hidden" id="mobile1" name="mobile" size="24" style="width:245px;"  value="<?php echo $modelcustomers->mobile;?>" />
      </p>
      <p><span><?php echo  Yii::t('base','Email');?></span>
        <input type="text" id="email1" name="email" size="24" style="width:245px;" value="<?php echo $modelcustomers->email;?>" />
      </p>
      <p><span><?php echo  Yii::t('base','Address');?></span>
        <input type="text" id="address1" name="address" size="24" style="width:245px;" value="<?php echo $modelcustomers->address;?>" />
      </p>
      <p><span><?php echo  Yii::t('base','Post Code');?> </span>
        <input type="text" id="post_code1" name="post_code" size="24" style="width:245px;" value="<?php echo $modelcustomers->post_code;?>" />
      </p>
	</div>
		<div class="row">
	<?php echo $form->labelEx($model,'notes'); ?>
		<?php echo $form->textArea($model,'notes');?>
		<?php echo $form->error($model,'notes'); ?>

</div>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Submit and Next >>' : 'Save'); ?>
	</div>
	
		<div class="row buttons">
		<?php echo CHtml::submitButton('submit',array('name'=>'stop','value'=>'Submit and Stop >>')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
<?php
Yii::app()->clientScript->registerScript('search', "
		$('#qualified').click(function(){
		$('#divform2').hide();
		$('#divform1').show();
		});
		");
Yii::app()->clientScript->registerScript('search1', "
		$('#won').click(function(){
		$('#divform1').hide();
			$('#divform2').show();
		});
		");

Yii::app()->clientScript->registerScript('search2', "
		$('#other1').click(function(){
		$('#divform1').hide();
			$('#divform2').hide();
		});
		
		$('#other2').click(function(){
		$('#divform1').hide();
			$('#divform2').hide();
		});
		
		$('#other3').click(function(){
		$('#divform1').hide();
			$('#divform2').hide();
		});
		
		$('#other4').click(function(){
		$('#divform1').hide();
			$('#divform2').hide();
		});
		
		$('#other5').click(function(){
		$('#divform1').hide();
			$('#divform2').hide();
		});
		");
 ?>